<?php
$skype = array();
$skype = Phpfox::getService('tnskype')->getSkype(Phpfox::getUserId());  
$phrase_skype = Phpfox::getPhrase('tnskype.skype');  
$phrase_active = Phpfox::getPhrase('tnskype.active');  
$phrase_yes = Phpfox::getPhrase('tnskype.yes');  
$phrase_no = Phpfox::getPhrase('tnskype.no');  
$can_have_skype = Phpfox::getUserParam('tnskype.can_have_skype_account');
$sControllerSkype = Phpfox::getLib('module')->getFullControllerName();
?>
<script type="text/javascript">
$Behavior.tnSkypeUser = function  () {
	$('.js_custom_change_group').click(function(event){
		var target = $( event.target );
		if(target.is('#group_basic')){
			$('#div_skype_account').show();
			$('#div_skype_active').show();	
		}else{
			$('#div_skype_account').hide();
			$('#div_skype_active').hide();		
		}
	});
};
</script>
<div>
<?php if($can_have_skype && ($sControllerSkype == 'user.profile')) { ?>
<div class="table" id ='div_skype_account' style="display:block">
			<div class="table_left">
				<label for="skype_account"><?php echo $phrase_skype;?>:</label>
			</div>
			<div class="table_right">
				<input type="text" name="val[skype_account]" id="skype_account" value="<?php if(isset($skype['skype_account'])) {echo $skype['skype_account'];}?>" size="20">
			</div>
			<div class="clear"></div>
</div>
<div class="table" id ='div_skype_active' style="display:block">
			<div class="table_left">
				<label for="skype_active"><span class="required"></span><?php echo $phrase_active;?>:</label>
			</div>
			<div class="table_right">
				<select name="val[skype_active]" id="skype_active">
					<option value=1 <?php if(isset($skype['active']) && $skype['active'] == 1 ) echo 'selected'; ?>><?php echo $phrase_yes;?></option>
					<option value=0 <?php if(isset($skype['active']) && $skype['active'] == 0 ) echo 'selected'; ?>><?php echo $phrase_no;?></option>
				</select>
			</div>
			<div class="clear"></div>
</div>
<?php } ?>
</div>